#ifndef INFINITY_WORLD_GRID_MANAGER_H
#	define INFINITY_WORLD_GRID_MANAGER_H

#include "gamemode.h"

#include "planet.h"
#include "planetcell.h"

namespace infinity {

class WorldGridManager
:	public dw::base::Singleton< WorldGridManager >
{
public : //! @name Types definitions
	//! @{
	enum Neighbor
	{
		N_LEFT = 0,
		N_RIGHT,
		N_TOP,
		N_BOTTOM,
		N_FRONT,
		N_BACK,
		N_MAX_NEIGHBOR
	};
	//! @}

public : //! @name Commands
	//! @{
	void initialize();
	//! @}

public : //! @name State
	//! @{
	Planet* getPlanet();
	const Planet* getPlanet() const ;
	void getCell(dw::int32 x, dw::int32 y, dw::int32 z, Planet::Cell& cell) const ;
	void setCell(dw::int32 x, dw::int32 y, dw::int32 z, const Planet::Cell& cell);
	//! @}

protected : //! @name Construction & Destruction
	//! @{
	friend dw::base::Singleton< WorldGridManager >;

	WorldGridManager();
	~WorldGridManager();
	//! @}

private : //! @name Data
	//! @{
	Planet* m_planet;
	//! @}
};

} // namespace infinity

#endif // !INFINITY_WORLD_GRID_MANAGER_H
